﻿<?xml version="1.0" encoding="utf-8" ?>

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="MSH.Common.Business" assembly="Common">

<class name="UserSession" table="USERSESSION">

  <id name="ID">

      <generator class="native">
        <param name="sequence">SeqUserSessionID</param>
      </generator>

  </id>

  <property name="Username">
    <column name="Username" length="30" not-null="true" unique="true"/> <!-- Unique constraint zorgt in Firebird al voor een index. -->
  </property>

  <property name="Token">
    <column name="Token" length="150" not-null="true" unique="true"/>
    <!-- Unique constraint zorgt in Firebird al voor een index. -->
  </property>

  <property name="MobilePhoneType">
    <column name="MobilePhoneType" not-null="true"/>
  </property>

  <property name="ExpirationTimestamp">
    <column name="ExpirationTimestamp" not-null="false"  />
  </property>

  <property name="LastLocationUpdate">
    <column name="LastLocationUpdate" not-null="false"/>
  </property>

  <property name="LocationUpdateRequested">
    <column name="LocationUpdateRequested" not-null="false" />
  </property>

  <set name="PersonNearby" cascade="all" order-by="ID">
    <key column="UserSession"/>
    <one-to-many class="PersonNearby"/>
  </set>

  <property name="WP7PushNotifactionURL">
    <column name="WP7PushNotifactionURL" not-null="false"/>
  </property>

</class>
</hibernate-mapping>

